import { MockEventsObject } from '../../../framework';
import { TOKEN_API_TOKENS_RESPONSE } from '../token-api-responses';

export const SWAPS_FEATURE_FLAG_RESPONSE = {
  ethereum: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {
      expectedDeadline: 45,
      maxDeadline: 160,
      returnTxHashAsap: false,
      mobileActive: true,
      extensionActive: true,
      mobileActiveIos: true,
      mobileActiveAndroid: true,
    },
  },
  bsc: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {
      mobileActive: true,
      extensionActive: true,
      mobileActiveIos: true,
      mobileActiveAndroid: true,
    },
  },
  polygon: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {},
  },
  avalanche: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {},
  },
  arbitrum: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {
      mobileActive: true,
      extensionActive: true,
      mobileActiveIos: true,
      mobileActiveAndroid: true,
    },
  },
  optimism: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {},
  },
  zksync: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {},
  },
  linea: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {},
  },
  base: {
    mobile_active: true,
    extension_active: true,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: false } },
    smartTransactions: {
      mobileActive: true,
      extensionActive: true,
      mobileActiveIos: true,
      mobileActiveAndroid: true,
    },
  },
  sei: {
    mobile_active: true,
    extension_active: false,
    fallback_to_v1: false,
    fallbackToV1: false,
    mobileActive: true,
    extensionActive: false,
    mobileActiveIOS: true,
    mobileActiveAndroid: true,
    v2: { swapAndSend: { enabled: true } },
    smartTransactions: {},
  },
  smart_transactions: { mobile_active: true, extension_active: true },
  smartTransactions: {
    mobileActive: true,
    extensionActive: true,
    mobileActiveIOS: false,
    mobileActiveAndroid: false,
    mobileReturnTxHashAsap: true,
    extensionReturnTxHashAsap: true,
    batchStatusPollingInterval: 5000,
  },
  transactions: {
    acceleratedPollingEnabled: false,
    acceleratedPollingInterval: 5,
    maxAcceleratedPolls: 0,
  },
  swapRedesign: { mobileActive: false, extensionActive: true },
  migrateToV2: { extensionActive: false, mobileActive: false },
  compliance: { merkleScienceMinThreshold: 25000 },
  multiChainAssets: { pollingSeconds: 0 },
};

/**
 * Minimal mock data for MetaMask swap API endpoints used in E2E testing.
 * Returns basic feature flags structure to prevent API failures.
 * For specific swap tests, add detailed mocks in the test files.
 */
export const SWAP_API_MOCKS: MockEventsObject = {
  GET: [
    {
      urlEndpoint: 'https://swap.dev-api.cx.metamask.io/featureFlags',
      responseCode: 200,
      response: SWAPS_FEATURE_FLAG_RESPONSE,
    },
    {
      urlEndpoint: 'https://swap.api.cx.metamask.io/featureFlags',
      responseCode: 200,
      response: SWAPS_FEATURE_FLAG_RESPONSE,
    },
    {
      urlEndpoint: 'https://swap.api.cx.metamask.io/networks/1/tokens',
      responseCode: 200,
      response: TOKEN_API_TOKENS_RESPONSE,
    },
    {
      urlEndpoint: 'https://swap.api.cx.metamask.io/networks/56/tokens',
      responseCode: 200,
      response: TOKEN_API_TOKENS_RESPONSE,
    },
    {
      urlEndpoint: 'https://swap.dev-api.cx.metamask.io/networks/1/tokens',
      responseCode: 200,
      response: TOKEN_API_TOKENS_RESPONSE,
    },
  ],
};
